<?php
/*
 * Collabtive Mobile API main Config 
 * If you make ANY updates to this file or any other file please change the information below to match 
 * your custom site api config. 
/*
 *  TYPES: 
 * O - Means it is  the official release from the main Collabitive CodePlex 
 * M - Means it was modified, you should probably change the major/minor/build
 *    to reflect your changes.
 * 
 * 
 */
$TYPE="O"; // Mine is official, Change this if your modifying the code in anyway. 

$Owner = "Darxval"; 
// A way to tag your version of the code. For instance you can have your app check, if Owner = Darxval, 
//then its okay to use this url, or if you have a custom collabtive build, you can have your app not use the normal version.
// Or write it to work with any version. Your choice

$MAJOR_VERSION=1;
$MINOR_VERSION=1;
$BUILD_VERSION=0;
/// The best part of using this versioning system is so you can manage which versions in your application it can support.

// Update this API Message per new version, and/or modifying the code in any way, it is a good way to tell the developer/user 
// thats hitting the API a message, and if his app will work against it. 
$APIMESSAGE = "This is an official release from codeplex Version: ".$MAJOR_VERSION.".".$MINOR_VERSION.".".$BUILD_VERSION." Please refer to the documentation here: http://collabitivemobileapi.codeplex.com/documentation   ";

$debug = false;  // Allow Debugging 
$debug_sessions = false; //Allow session bypass
 
if($_POST['sid'])
{
  $sessionid=$_POST['sid'];
}
else if($_GET['sid'])
{
  $sessionid = $_GET['sid'];  
}

$session = session_id($sessionid);
session_start();
 
 
// Debug stuff below 

if($_GET['debug'] == 1 && $debug == true) // only allow debugging if debug is turned on.
{
    
    echo "SID: ".SID."<br>session_id(): ".session_id()."<br>COOKIE: ".$_COOKIE["PHPSESSID"]." User session Info: ".$_SESSION['username']." ".$_SESSION['userid'];
    error_reporting(E_ALL);
    ini_set('display_errors', '1'); 
   
}
if($_GET['nosession']==1 && $debug_sessions==true ) // Only allow session turn on & off if sessionDebug is true.
{
    $sessionEnabled = false;
}
else
{
    $sessionEnabled = true;      
}
$con = mysqli_connect($db_host,$db_user,$db_pass);



if(!$con)
{
    die('Could not connect: '. mysql_error());
}
mysqli_select_db($con,$db_name);
  

?>